package com.study.myteach.组合模式;

import java.util.ArrayList;

/**
 * @author lk
 * @date 2021/4/3 0003 15:30
 * @description:
 */
public class CompositeShape implements IShape {
    private ArrayList<IShape> list = new ArrayList<>();

    public void add(IShape iShape){
        list.add(iShape);
    }
    @Override
    public void draw() {
        for (IShape iShape : list) {
            iShape.draw();
        }
    }
}
